package com.example.gpstracking.database;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper;

public class MySqliteHelper extends SQLiteOpenHelper {
	private static  MySqliteHelper mMySqliteHelper;
	//public static String path ="/data/data/com.example.gpstracking/databases/";
	//
	public static String NAME_DB = "namedb";
	public static String NAME_TABLE = "nametable";
	public static String TABLE_TIME = "time";
	public static String TABLE_LAT = "lat";
	public static String TABLE_LONG = "long";
	//
	public String createTable = "create table " +  NAME_TABLE + " ( " + TABLE_TIME + " text not null , " + TABLE_LAT + " text not null , "+ TABLE_LONG + " text not null );" ;
	//
	public static MySqliteHelper getInstance(Context context)
	{
		if(mMySqliteHelper == null)
		{
			mMySqliteHelper = new MySqliteHelper(context, NAME_DB, null, 1);
		}
		return mMySqliteHelper;
		
	}

	public MySqliteHelper(Context context, String name, CursorFactory factory,
			int version) {
		super(context, name, factory, version);
		// TODO Auto-generated constructor stub
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		// TODO Auto-generated method stub
		db.execSQL(createTable);
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		// TODO Auto-generated method stub
		
	}

}
